<% (display-partial "doctype") %>
<head>
	<% (display-partial "header") %>
</head>

<body>

<div id="wrap">
	<div id="header">
		<% (display-partial "navigation") %>	
		<div class="clear"></div>
	</div>

	<div id="content">
				
		<div class="title nomargin">
			<p><% (title "| Dragonfly web framework") %><p>
		</div>
		
		<h1>Reading feeds from other websites</h1>
		<p class="extract">Dragonfly provides some simple functions for reading atom feeds (RSS will follow). The name Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (AtomPub or APP) is a simple HTTP-based protocol for creating and updating web resources. (source: wikipedia.org)
		</p>
		<p>
			There are two functions in <b>plugins-active/dragonfly_basic.lsp</b> for reading feeds: <span class="code">read-atom-feed</span> and <span class="code">read-rss-feed</span>. They can be used to read feeds server-side. If you want to load a feed on the client's side, use AJAX and Javascript instead for faster page loads and to offload work from the server.
		</p>
		<h2>Example: displaying an atom feed</h2>
		<p>The following will display all of the entries from the atom feed as HTML:</p>
		<pre class="code">&lt;% (read-atom-feed "http://website.com/atomfeed.xml") %&gt;</pre>
		<p>
			If you'd like to limit the number of entries shown:
		</p>
		<pre class="code">&lt;% (read-atom-feed "http://website.com/atomfeed.xml" 3) %&gt;</pre>
		<p>If you want to see the raw XML without limiting the number of entries:</p>
		<pre class="code">&lt;% (read-atom-feed "http://website.com/atomfeed.xml" nil true) %&gt;</pre>
		
		<p>
			The <span class="code">read-rss-feed</span> function works in the same manner. These functions are used to display the feed below:
		</p>

		<h2>NYTimes.com (RSS)</h2>
		<p>
		<% (read-rss-feed "http://www.nytimes.com/services/xml/rss/nyt/GlobalHome.xml" 3) %>
		</p>
		
		<div class="line-dotted"></div>

		<% (benchmark-result) %>
		
		<div class="line-dotted"></div>
		
		
	</div><!-- END CONTENT -->
	
</div><!-- END WRAP -->
<% (display-partial "footer") %>

